package com.atgui.github.controller;

import com.atgui.github.service.GithubClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class GithubController {

    @Resource
    private GithubClient githubClient;

    @GetMapping("/github/search")
    public Object searchRepo(@RequestParam("repo") String queryString) {
        String result = githubClient.searchRepo(queryString);
        return result;
    }
}
